#ifndef UTIL_H
#define UTIL_H

#include <vector>
#include <string>
// #include<fstream>
// #include<iostream>
#include <sstream>
// #include <string>

// (*) include lexical analyser header
#include <./depythonize_c_lex>

int count_new_lines(std::vector<quex::Token>& tokens_between_code);
void get_token(quex::Token& token, quex::depythonize_c_lex& qlex, std::vector<quex::Token>& tokens_between_code);
bool is_in_buffer(std::vector<quex::Token>& history, unsigned int TYPE_ID);
void write_out(std::ostringstream & osstream, std::vector<quex::Token>& tokens_between_code);
void program_mode(  std::ostringstream & osstream
                  , quex::depythonize_c_lex & qlex
                  , quex::Token & token
                  , quex::Token & tokenNext
                  , std::vector<quex::Token> & tokens_before_token
                  , std::vector<quex::Token> & tokens_before_tokenNext
                  );
void preprocessor_mode( std::ostringstream & osstream
                  , quex::depythonize_c_lex & qlex
                  , quex::Token & token
                  , quex::Token & tokenNext
                  , std::vector<quex::Token> & tokens_before_token
                  , std::vector<quex::Token> & tokens_before_tokenNext
                  );
void print_many_block_close(  std::ostringstream & osstream
                  , quex::depythonize_c_lex & qlex
                  , quex::Token & token
                  , quex::Token & tokenNext
                  , std::vector<quex::Token> & tokens_before_token
                  , std::vector<quex::Token> & tokens_before_tokenNext
                  , bool preprocessor_multiline_end=false
                  );

#endif
